package com.salton123.ui.base

import android.os.Bundle
import android.view.View
import androidx.fragment.app.FragmentActivity

/**
 * User: newSalton@outlook.com
 * Date: 2019/3/19 10:01
 * ModifyTime: 10:01
 * Description:
 */
interface IComponentLife : View.OnClickListener {
    fun inflateContentView(isAsync: Boolean, layoutId: Int, callback: () -> Unit)
    fun inflateTitleBar(isAsync: Boolean, layoutId: Int, callback: () -> Unit)
    fun activity(): FragmentActivity
    fun <T : View> f(resId: Int): T

    fun longToast(toast: String) //长Toast
    fun shortToast(toast: String) //短Toast
    fun log(msg: String)
    fun openActivity(clz: Class<*>, bundle: Bundle?)
    fun openActivityForResult(clz: Class<*>, bundle: Bundle?, requestCode: Int)
    fun setListener(vararg ids: Int)
    fun setListener(vararg views: View)
    fun show(vararg views: View)
    fun hide(vararg views: View)
    fun self(): IComponentLife
}